package com.cn.ycy;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
public class CommandApplication extends SpringBootServletInitializer implements CommandLineRunner {

    public static void main(String[] args) {
        new SpringApplicationBuilder(CommandApplication.class)
                .web(WebApplicationType.NONE) // 禁用 Web 环境
                .run(args);
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("Hello, World!");
        // 在这里添加你需要执行的任务
    }
}